home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / dev / gcc / ppc-mos-gcc.lha / info / gcc.info-20 (.txt) < prev    next >
GNU Info File  |  2002-06-18  |  51KB  |  937 lines

  1. This is Info file gcc.info, produced by Makeinfo version 1.68 from the
  2. input file ./gcc.texi.
  3. INFO-DIR-SECTION Programming
  4. START-INFO-DIR-ENTRY
  5. * gcc: (gcc).                  The GNU Compiler Collection.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the use and the internals of the GNU compiler.
  8.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  9. Boston, MA 02111-1307 USA
  10.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
  11. 1999, 2000 Free Software Foundation, Inc.
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Funding
  18. for Free Software" are included exactly as in the original, and
  19. provided that the entire resulting derived work is distributed under
  20. the terms of a permission notice identical to this one.
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "GNU General Public
  24. License" and "Funding for Free Software", and this permission notice,
  25. may be included in translations approved by the Free Software Foundation
  26. instead of in the original English.
  27. File: gcc.info,  Node: Dependent Patterns,  Next: Jump Patterns,  Prev: Pattern Ordering,  Up: Machine Desc
  28. Interdependence of Patterns
  29. ===========================
  30.    Every machine description must have a named pattern for each of the
  31. conditional branch names `bCOND'.  The recognition template must always
  32. have the form
  33.      (set (pc)
  34.           (if_then_else (COND (cc0) (const_int 0))
  35.                         (label_ref (match_operand 0 "" ""))
  36.                         (pc)))
  37. In addition, every machine description must have an anonymous pattern
  38. for each of the possible reverse-conditional branches.  Their templates
  39. look like
  40.      (set (pc)
  41.           (if_then_else (COND (cc0) (const_int 0))
  42.                         (pc)
  43.                         (label_ref (match_operand 0 "" ""))))
  44. They are necessary because jump optimization can turn direct-conditional
  45. branches into reverse-conditional branches.
  46.    It is often convenient to use the `match_operator' construct to
  47. reduce the number of patterns that must be specified for branches.  For
  48. example,
  49.      (define_insn ""
  50.        [(set (pc)
  51.              (if_then_else (match_operator 0 "comparison_operator"
  52.                                            [(cc0) (const_int 0)])
  53.                            (pc)
  54.                            (label_ref (match_operand 1 "" ""))))]
  55.        "CONDITION"
  56.        "...")
  57.    In some cases machines support instructions identical except for the
  58. machine mode of one or more operands.  For example, there may be
  59. "sign-extend halfword" and "sign-extend byte" instructions whose
  60. patterns are
  61.      (set (match_operand:SI 0 ...)
  62.           (extend:SI (match_operand:HI 1 ...)))
  63.      
  64.      (set (match_operand:SI 0 ...)
  65.           (extend:SI (match_operand:QI 1 ...)))
  66. Constant integers do not specify a machine mode, so an instruction to
  67. extend a constant value could match either pattern.  The pattern it
  68. actually will match is the one that appears first in the file.  For
  69. correct results, this must be the one for the widest possible mode
  70. (`HImode', here).  If the pattern matches the `QImode' instruction, the
  71. results will be incorrect if the constant value does not actually fit
  72. that mode.
  73.    Such instructions to extend constants are rarely generated because
  74. they are optimized away, but they do occasionally happen in nonoptimized
  75. compilations.
  76.    If a constraint in a pattern allows a constant, the reload pass may
  77. replace a register with a constant permitted by the constraint in some
  78. cases.  Similarly for memory references.  Because of this substitution,
  79. you should not provide separate patterns for increment and decrement
  80. instructions.  Instead, they should be generated from the same pattern
  81. that supports register-register add insns by examining the operands and
  82. generating the appropriate machine instruction.
  83. File: gcc.info,  Node: Jump Patterns,  Next: Insn Canonicalizations,  Prev: Dependent Patterns,  Up: Machine Desc
  84. Defining Jump Instruction Patterns
  85. ==================================
  86.    For most machines, GNU CC assumes that the machine has a condition
  87. code.  A comparison insn sets the condition code, recording the results
  88. of both signed and unsigned comparison of the given operands.  A
  89. separate branch insn tests the condition code and branches or not
  90. according its value.  The branch insns come in distinct signed and
  91. unsigned flavors.  Many common machines, such as the Vax, the 68000 and
  92. the 32000, work this way.
  93.    Some machines have distinct signed and unsigned compare
  94. instructions, and only one set of conditional branch instructions.  The
  95. easiest way to handle these machines is to treat them just like the
  96. others until the final stage where assembly code is written.  At this
  97. time, when outputting code for the compare instruction, peek ahead at
  98. the following branch using `next_cc0_user (insn)'.  (The variable
  99. `insn' refers to the insn being output, in the output-writing code in
  100. an instruction pattern.)  If the RTL says that is an unsigned branch,
  101. output an unsigned compare; otherwise output a signed compare.  When
  102. the branch itself is output, you can treat signed and unsigned branches
  103. identically.
  104.    The reason you can do this is that GNU CC always generates a pair of
  105. consecutive RTL insns, possibly separated by `note' insns, one to set
  106. the condition code and one to test it, and keeps the pair inviolate
  107. until the end.
  108.    To go with this technique, you must define the machine-description
  109. macro `NOTICE_UPDATE_CC' to do `CC_STATUS_INIT'; in other words, no
  110. compare instruction is superfluous.
  111.    Some machines have compare-and-branch instructions and no condition
  112. code.  A similar technique works for them.  When it is time to "output"
  113. a compare instruction, record its operands in two static variables.
  114. When outputting the branch-on-condition-code instruction that follows,
  115. actually output a compare-and-branch instruction that uses the
  116. remembered operands.
  117.    It also works to define patterns for compare-and-branch instructions.
  118. In optimizing compilation, the pair of compare and branch instructions
  119. will be combined according to these patterns.  But this does not happen
  120. if optimization is not requested.  So you must use one of the solutions
  121. above in addition to any special patterns you define.
  122.    In many RISC machines, most instructions do not affect the condition
  123. code and there may not even be a separate condition code register.  On
  124. these machines, the restriction that the definition and use of the
  125. condition code be adjacent insns is not necessary and can prevent
  126. important optimizations.  For example, on the IBM RS/6000, there is a
  127. delay for taken branches unless the condition code register is set three
  128. instructions earlier than the conditional branch.  The instruction
  129. scheduler cannot perform this optimization if it is not permitted to
  130. separate the definition and use of the condition code register.
  131.    On these machines, do not use `(cc0)', but instead use a register to
  132. represent the condition code.  If there is a specific condition code
  133. register in the machine, use a hard register.  If the condition code or
  134. comparison result can be placed in any general register, or if there are
  135. multiple condition registers, use a pseudo register.
  136.    On some machines, the type of branch instruction generated may
  137. depend on the way the condition code was produced; for example, on the
  138. 68k and Sparc, setting the condition code directly from an add or
  139. subtract instruction does not clear the overflow bit the way that a test
  140. instruction does, so a different branch instruction must be used for
  141. some conditional branches.  For machines that use `(cc0)', the set and
  142. use of the condition code must be adjacent (separated only by `note'
  143. insns) allowing flags in `cc_status' to be used.  (*Note Condition
  144. Code::.)  Also, the comparison and branch insns can be located from
  145. each other by using the functions `prev_cc0_setter' and `next_cc0_user'.
  146.    However, this is not true on machines that do not use `(cc0)'.  On
  147. those machines, no assumptions can be made about the adjacency of the
  148. compare and branch insns and the above methods cannot be used.  Instead,
  149. we use the machine mode of the condition code register to record
  150. different formats of the condition code register.
  151.    Registers used to store the condition code value should have a mode
  152. that is in class `MODE_CC'.  Normally, it will be `CCmode'.  If
  153. additional modes are required (as for the add example mentioned above in
  154. the Sparc), define the macro `EXTRA_CC_MODES' to list the additional
  155. modes required (*note Condition Code::.).  Also define `EXTRA_CC_NAMES'
  156. to list the names of those modes and `SELECT_CC_MODE' to choose a mode
  157. given an operand of a compare.
  158.    If it is known during RTL generation that a different mode will be
  159. required (for example, if the machine has separate compare instructions
  160. for signed and unsigned quantities, like most IBM processors), they can
  161. be specified at that time.
  162.    If the cases that require different modes would be made by
  163. instruction combination, the macro `SELECT_CC_MODE' determines which
  164. machine mode should be used for the comparison result.  The patterns
  165. should be written using that mode.  To support the case of the add on
  166. the Sparc discussed above, we have the pattern
  167.      (define_insn ""
  168.        [(set (reg:CC_NOOV 0)
  169.              (compare:CC_NOOV
  170.                (plus:SI (match_operand:SI 0 "register_operand" "%r")
  171.                         (match_operand:SI 1 "arith_operand" "rI"))
  172.                (const_int 0)))]
  173.        ""
  174.        "...")
  175.    The `SELECT_CC_MODE' macro on the Sparc returns `CC_NOOVmode' for
  176. comparisons whose argument is a `plus'.
  177. File: gcc.info,  Node: Insn Canonicalizations,  Next: Peephole Definitions,  Prev: Jump Patterns,  Up: Machine Desc
  178. Canonicalization of Instructions
  179. ================================
  180.    There are often cases where multiple RTL expressions could represent
  181. an operation performed by a single machine instruction.  This situation
  182. is most commonly encountered with logical, branch, and
  183. multiply-accumulate instructions.  In such cases, the compiler attempts
  184. to convert these multiple RTL expressions into a single canonical form
  185. to reduce the number of insn patterns required.
  186.    In addition to algebraic simplifications, following canonicalizations
  187. are performed:
  188.    * For commutative and comparison operators, a constant is always
  189.      made the second operand.  If a machine only supports a constant as
  190.      the second operand, only patterns that match a constant in the
  191.      second operand need be supplied.
  192.      For these operators, if only one operand is a `neg', `not',
  193.      `mult', `plus', or `minus' expression, it will be the first
  194.      operand.
  195.    * For the `compare' operator, a constant is always the second operand
  196.      on machines where `cc0' is used (*note Jump Patterns::.).  On other
  197.      machines, there are rare cases where the compiler might want to
  198.      construct a `compare' with a constant as the first operand.
  199.      However, these cases are not common enough for it to be worthwhile
  200.      to provide a pattern matching a constant as the first operand
  201.      unless the machine actually has such an instruction.
  202.      An operand of `neg', `not', `mult', `plus', or `minus' is made the
  203.      first operand under the same conditions as above.
  204.    * `(minus X (const_int N))' is converted to `(plus X (const_int
  205.      -N))'.
  206.    * Within address computations (i.e., inside `mem'), a left shift is
  207.      converted into the appropriate multiplication by a power of two.
  208.    * De`Morgan's Law is used to move bitwise negation inside a bitwise
  209.      logical-and or logical-or operation.  If this results in only one
  210.      operand being a `not' expression, it will be the first one.
  211.      A machine that has an instruction that performs a bitwise
  212.      logical-and of one operand with the bitwise negation of the other
  213.      should specify the pattern for that instruction as
  214.           (define_insn ""
  215.             [(set (match_operand:M 0 ...)
  216.                   (and:M (not:M (match_operand:M 1 ...))
  217.                                (match_operand:M 2 ...)))]
  218.             "..."
  219.             "...")
  220.      Similarly, a pattern for a "NAND" instruction should be written
  221.           (define_insn ""
  222.             [(set (match_operand:M 0 ...)
  223.                   (ior:M (not:M (match_operand:M 1 ...))
  224.                                (not:M (match_operand:M 2 ...))))]
  225.             "..."
  226.             "...")
  227.      In both cases, it is not necessary to include patterns for the many
  228.      logically equivalent RTL expressions.
  229.    * The only possible RTL expressions involving both bitwise
  230.      exclusive-or and bitwise negation are `(xor:M X Y)' and `(not:M
  231.      (xor:M X Y))'.
  232.    * The sum of three items, one of which is a constant, will only
  233.      appear in the form
  234.           (plus:M (plus:M X Y) CONSTANT)
  235.    * On machines that do not use `cc0', `(compare X (const_int 0))'
  236.      will be converted to X.
  237.    * Equality comparisons of a group of bits (usually a single bit)
  238.      with zero will be written using `zero_extract' rather than the
  239.      equivalent `and' or `sign_extract' operations.
  240. File: gcc.info,  Node: Peephole Definitions,  Next: Expander Definitions,  Prev: Insn Canonicalizations,  Up: Machine Desc
  241. Machine-Specific Peephole Optimizers
  242. ====================================
  243.    In addition to instruction patterns the `md' file may contain
  244. definitions of machine-specific peephole optimizations.
  245.    The combiner does not notice certain peephole optimizations when the
  246. data flow in the program does not suggest that it should try them.  For
  247. example, sometimes two consecutive insns related in purpose can be
  248. combined even though the second one does not appear to use a register
  249. computed in the first one.  A machine-specific peephole optimizer can
  250. detect such opportunities.
  251.    A definition looks like this:
  252.      (define_peephole
  253.        [INSN-PATTERN-1
  254.         INSN-PATTERN-2
  255.         ...]
  256.        "CONDITION"
  257.        "TEMPLATE"
  258.        "OPTIONAL INSN-ATTRIBUTES")
  259. The last string operand may be omitted if you are not using any
  260. machine-specific information in this machine description.  If present,
  261. it must obey the same rules as in a `define_insn'.
  262.    In this skeleton, INSN-PATTERN-1 and so on are patterns to match
  263. consecutive insns.  The optimization applies to a sequence of insns when
  264. INSN-PATTERN-1 matches the first one, INSN-PATTERN-2 matches the next,
  265. and so on.
  266.    Each of the insns matched by a peephole must also match a
  267. `define_insn'.  Peepholes are checked only at the last stage just
  268. before code generation, and only optionally.  Therefore, any insn which
  269. would match a peephole but no `define_insn' will cause a crash in code
  270. generation in an unoptimized compilation, or at various optimization
  271. stages.
  272.    The operands of the insns are matched with `match_operands',
  273. `match_operator', and `match_dup', as usual.  What is not usual is that
  274. the operand numbers apply to all the insn patterns in the definition.
  275. So, you can check for identical operands in two insns by using
  276. `match_operand' in one insn and `match_dup' in the other.
  277.    The operand constraints used in `match_operand' patterns do not have
  278. any direct effect on the applicability of the peephole, but they will
  279. be validated afterward, so make sure your constraints are general enough
  280. to apply whenever the peephole matches.  If the peephole matches but
  281. the constraints are not satisfied, the compiler will crash.
  282.    It is safe to omit constraints in all the operands of the peephole;
  283. or you can write constraints which serve as a double-check on the
  284. criteria previously tested.
  285.    Once a sequence of insns matches the patterns, the CONDITION is
  286. checked.  This is a C expression which makes the final decision whether
  287. to perform the optimization (we do so if the expression is nonzero).  If
  288. CONDITION is omitted (in other words, the string is empty) then the
  289. optimization is applied to every sequence of insns that matches the
  290. patterns.
  291.    The defined peephole optimizations are applied after register
  292. allocation is complete.  Therefore, the peephole definition can check
  293. which operands have ended up in which kinds of registers, just by
  294. looking at the operands.
  295.    The way to refer to the operands in CONDITION is to write
  296. `operands[I]' for operand number I (as matched by `(match_operand I
  297. ...)').  Use the variable `insn' to refer to the last of the insns
  298. being matched; use `prev_active_insn' to find the preceding insns.
  299.    When optimizing computations with intermediate results, you can use
  300. CONDITION to match only when the intermediate results are not used
  301. elsewhere.  Use the C expression `dead_or_set_p (INSN, OP)', where INSN
  302. is the insn in which you expect the value to be used for the last time
  303. (from the value of `insn', together with use of `prev_nonnote_insn'),
  304. and OP is the intermediate value (from `operands[I]').
  305.    Applying the optimization means replacing the sequence of insns with
  306. one new insn.  The TEMPLATE controls ultimate output of assembler code
  307. for this combined insn.  It works exactly like the template of a
  308. `define_insn'.  Operand numbers in this template are the same ones used
  309. in matching the original sequence of insns.
  310.    The result of a defined peephole optimizer does not need to match
  311. any of the insn patterns in the machine description; it does not even
  312. have an opportunity to match them.  The peephole optimizer definition
  313. itself serves as the insn pattern to control how the insn is output.
  314.    Defined peephole optimizers are run as assembler code is being
  315. output, so the insns they produce are never combined or rearranged in
  316. any way.
  317.    Here is an example, taken from the 68000 machine description:
  318.      (define_peephole
  319.        [(set (reg:SI 15) (plus:SI (reg:SI 15) (const_int 4)))
  320.         (set (match_operand:DF 0 "register_operand" "=f")
  321.              (match_operand:DF 1 "register_operand" "ad"))]
  322.        "FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])"
  323.        "*
  324.      {
  325.        rtx xoperands[2];
  326.        xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
  327.      #ifdef MOTOROLA
  328.        output_asm_insn (\"move.l %1,(sp)\", xoperands);
  329.        output_asm_insn (\"move.l %1,-(sp)\", operands);
  330.        return \"fmove.d (sp)+,%0\";
  331.      #else
  332.        output_asm_insn (\"movel %1,sp@\", xoperands);
  333.        output_asm_insn (\"movel %1,sp@-\", operands);
  334.        return \"fmoved sp@+,%0\";
  335.      #endif
  336.      }
  337.      ")
  338.    The effect of this optimization is to change
  339.      jbsr _foobar
  340.      addql #4,sp
  341.      movel d1,sp@-
  342.      movel d0,sp@-
  343.      fmoved sp@+,fp0
  344.      jbsr _foobar
  345.      movel d1,sp@
  346.      movel d0,sp@-
  347.      fmoved sp@+,fp0
  348.    INSN-PATTERN-1 and so on look *almost* like the second operand of
  349. `define_insn'.  There is one important difference: the second operand
  350. of `define_insn' consists of one or more RTX's enclosed in square
  351. brackets.  Usually, there is only one: then the same action can be
  352. written as an element of a `define_peephole'.  But when there are
  353. multiple actions in a `define_insn', they are implicitly enclosed in a
  354. `parallel'.  Then you must explicitly write the `parallel', and the
  355. square brackets within it, in the `define_peephole'.  Thus, if an insn
  356. pattern looks like this,
  357.      (define_insn "divmodsi4"
  358.        [(set (match_operand:SI 0 "general_operand" "=d")
  359.              (div:SI (match_operand:SI 1 "general_operand" "0")
  360.                      (match_operand:SI 2 "general_operand" "dmsK")))
  361.         (set (match_operand:SI 3 "general_operand" "=d")
  362.              (mod:SI (match_dup 1) (match_dup 2)))]
  363.        "TARGET_68020"
  364.        "divsl%.l %2,%3:%0")
  365. then the way to mention this insn in a peephole is as follows:
  366.      (define_peephole
  367.        [...
  368.         (parallel
  369.          [(set (match_operand:SI 0 "general_operand" "=d")
  370.                (div:SI (match_operand:SI 1 "general_operand" "0")
  371.                        (match_operand:SI 2 "general_operand" "dmsK")))
  372.           (set (match_operand:SI 3 "general_operand" "=d")
  373.                (mod:SI (match_dup 1) (match_dup 2)))])
  374.         ...]
  375.        ...)
  376. File: gcc.info,  Node: Expander Definitions,  Next: Insn Splitting,  Prev: Peephole Definitions,  Up: Machine Desc
  377. Defining RTL Sequences for Code Generation
  378. ==========================================
  379.    On some target machines, some standard pattern names for RTL
  380. generation cannot be handled with single insn, but a sequence of RTL
  381. insns can represent them.  For these target machines, you can write a
  382. `define_expand' to specify how to generate the sequence of RTL.
  383.    A `define_expand' is an RTL expression that looks almost like a
  384. `define_insn'; but, unlike the latter, a `define_expand' is used only
  385. for RTL generation and it can produce more than one RTL insn.
  386.    A `define_expand' RTX has four operands:
  387.    * The name.  Each `define_expand' must have a name, since the only
  388.      use for it is to refer to it by name.
  389.    * The RTL template.  This is just like the RTL template for a
  390.      `define_peephole' in that it is a vector of RTL expressions each
  391.      being one insn.
  392.    * The condition, a string containing a C expression.  This
  393.      expression is used to express how the availability of this pattern
  394.      depends on subclasses of target machine, selected by command-line
  395.      options when GNU CC is run.  This is just like the condition of a
  396.      `define_insn' that has a standard name.  Therefore, the condition
  397.      (if present) may not depend on the data in the insn being matched,
  398.      but only the target-machine-type flags.  The compiler needs to
  399.      test these conditions during initialization in order to learn
  400.      exactly which named instructions are available in a particular run.
  401.    * The preparation statements, a string containing zero or more C
  402.      statements which are to be executed before RTL code is generated
  403.      from the RTL template.
  404.      Usually these statements prepare temporary registers for use as
  405.      internal operands in the RTL template, but they can also generate
  406.      RTL insns directly by calling routines such as `emit_insn', etc.
  407.      Any such insns precede the ones that come from the RTL template.
  408.    Every RTL insn emitted by a `define_expand' must match some
  409. `define_insn' in the machine description.  Otherwise, the compiler will
  410. crash when trying to generate code for the insn or trying to optimize
  411.    The RTL template, in addition to controlling generation of RTL insns,
  412. also describes the operands that need to be specified when this pattern
  413. is used.  In particular, it gives a predicate for each operand.
  414.    A true operand, which needs to be specified in order to generate RTL
  415. from the pattern, should be described with a `match_operand' in its
  416. first occurrence in the RTL template.  This enters information on the
  417. operand's predicate into the tables that record such things.  GNU CC
  418. uses the information to preload the operand into a register if that is
  419. required for valid RTL code.  If the operand is referred to more than
  420. once, subsequent references should use `match_dup'.
  421.    The RTL template may also refer to internal "operands" which are
  422. temporary registers or labels used only within the sequence made by the
  423. `define_expand'.  Internal operands are substituted into the RTL
  424. template with `match_dup', never with `match_operand'.  The values of
  425. the internal operands are not passed in as arguments by the compiler
  426. when it requests use of this pattern.  Instead, they are computed
  427. within the pattern, in the preparation statements.  These statements
  428. compute the values and store them into the appropriate elements of
  429. `operands' so that `match_dup' can find them.
  430.    There are two special macros defined for use in the preparation
  431. statements: `DONE' and `FAIL'.  Use them with a following semicolon, as
  432. a statement.
  433. `DONE'
  434.      Use the `DONE' macro to end RTL generation for the pattern.  The
  435.      only RTL insns resulting from the pattern on this occasion will be
  436.      those already emitted by explicit calls to `emit_insn' within the
  437.      preparation statements; the RTL template will not be generated.
  438. `FAIL'
  439.      Make the pattern fail on this occasion.  When a pattern fails, it
  440.      means that the pattern was not truly available.  The calling
  441.      routines in the compiler will try other strategies for code
  442.      generation using other patterns.
  443.      Failure is currently supported only for binary (addition,
  444.      multiplication, shifting, etc.) and bitfield (`extv', `extzv', and
  445.      `insv') operations.
  446.    Here is an example, the definition of left-shift for the SPUR chip:
  447.      (define_expand "ashlsi3"
  448.        [(set (match_operand:SI 0 "register_operand" "")
  449.              (ashift:SI
  450.                (match_operand:SI 1 "register_operand" "")
  451.                (match_operand:SI 2 "nonmemory_operand" "")))]
  452.        ""
  453.        "
  454.      {
  455.        if (GET_CODE (operands[2]) != CONST_INT
  456.            || (unsigned) INTVAL (operands[2]) > 3)
  457.          FAIL;
  458.      }")
  459. This example uses `define_expand' so that it can generate an RTL insn
  460. for shifting when the shift-count is in the supported range of 0 to 3
  461. but fail in other cases where machine insns aren't available.  When it
  462. fails, the compiler tries another strategy using different patterns
  463. (such as, a library call).
  464.    If the compiler were able to handle nontrivial condition-strings in
  465. patterns with names, then it would be possible to use a `define_insn'
  466. in that case.  Here is another case (zero-extension on the 68000) which
  467. makes more use of the power of `define_expand':
  468.      (define_expand "zero_extendhisi2"
  469.        [(set (match_operand:SI 0 "general_operand" "")
  470.              (const_int 0))
  471.         (set (strict_low_part
  472.                (subreg:HI
  473.                  (match_dup 0)
  474.                  0))
  475.              (match_operand:HI 1 "general_operand" ""))]
  476.        ""
  477.        "operands[1] = make_safe_from (operands[1], operands[0]);")
  478. Here two RTL insns are generated, one to clear the entire output operand
  479. and the other to copy the input operand into its low half.  This
  480. sequence is incorrect if the input operand refers to [the old value of]
  481. the output operand, so the preparation statement makes sure this isn't
  482. so.  The function `make_safe_from' copies the `operands[1]' into a
  483. temporary register if it refers to `operands[0]'.  It does this by
  484. emitting another RTL insn.
  485.    Finally, a third example shows the use of an internal operand.
  486. Zero-extension on the SPUR chip is done by `and'-ing the result against
  487. a halfword mask.  But this mask cannot be represented by a `const_int'
  488. because the constant value is too large to be legitimate on this
  489. machine.  So it must be copied into a register with `force_reg' and
  490. then the register used in the `and'.
  491.      (define_expand "zero_extendhisi2"
  492.        [(set (match_operand:SI 0 "register_operand" "")
  493.              (and:SI (subreg:SI
  494.                        (match_operand:HI 1 "register_operand" "")
  495.                        0)
  496.                      (match_dup 2)))]
  497.        ""
  498.        "operands[2]
  499.           = force_reg (SImode, GEN_INT (65535)); ")
  500.    *Note:* If the `define_expand' is used to serve a standard binary or
  501. unary arithmetic operation or a bitfield operation, then the last insn
  502. it generates must not be a `code_label', `barrier' or `note'.  It must
  503. be an `insn', `jump_insn' or `call_insn'.  If you don't need a real insn
  504. at the end, emit an insn to copy the result of the operation into
  505. itself.  Such an insn will generate no code, but it can avoid problems
  506. in the compiler.
  507. File: gcc.info,  Node: Insn Splitting,  Next: Insn Attributes,  Prev: Expander Definitions,  Up: Machine Desc
  508. Defining How to Split Instructions
  509. ==================================
  510.    There are two cases where you should specify how to split a pattern
  511. into multiple insns.  On machines that have instructions requiring delay
  512. slots (*note Delay Slots::.) or that have instructions whose output is
  513. not available for multiple cycles (*note Function Units::.), the
  514. compiler phases that optimize these cases need to be able to move insns
  515. into one-instruction delay slots.  However, some insns may generate
  516. more than one machine instruction.  These insns cannot be placed into a
  517. delay slot.
  518.    Often you can rewrite the single insn as a list of individual insns,
  519. each corresponding to one machine instruction.  The disadvantage of
  520. doing so is that it will cause the compilation to be slower and require
  521. more space.  If the resulting insns are too complex, it may also
  522. suppress some optimizations.  The compiler splits the insn if there is a
  523. reason to believe that it might improve instruction or delay slot
  524. scheduling.
  525.    The insn combiner phase also splits putative insns.  If three insns
  526. are merged into one insn with a complex expression that cannot be
  527. matched by some `define_insn' pattern, the combiner phase attempts to
  528. split the complex pattern into two insns that are recognized.  Usually
  529. it can break the complex pattern into two patterns by splitting out some
  530. subexpression.  However, in some other cases, such as performing an
  531. addition of a large constant in two insns on a RISC machine, the way to
  532. split the addition into two insns is machine-dependent.
  533.    The `define_split' definition tells the compiler how to split a
  534. complex insn into several simpler insns.  It looks like this:
  535.      (define_split
  536.        [INSN-PATTERN]
  537.        "CONDITION"
  538.        [NEW-INSN-PATTERN-1
  539.         NEW-INSN-PATTERN-2
  540.         ...]
  541.        "PREPARATION STATEMENTS")
  542.    INSN-PATTERN is a pattern that needs to be split and CONDITION is
  543. the final condition to be tested, as in a `define_insn'.  When an insn
  544. matching INSN-PATTERN and satisfying CONDITION is found, it is replaced
  545. in the insn list with the insns given by NEW-INSN-PATTERN-1,
  546. NEW-INSN-PATTERN-2, etc.
  547.    The PREPARATION STATEMENTS are similar to those statements that are
  548. specified for `define_expand' (*note Expander Definitions::.)  and are
  549. executed before the new RTL is generated to prepare for the generated
  550. code or emit some insns whose pattern is not fixed.  Unlike those in
  551. `define_expand', however, these statements must not generate any new
  552. pseudo-registers.  Once reload has completed, they also must not
  553. allocate any space in the stack frame.
  554.    Patterns are matched against INSN-PATTERN in two different
  555. circumstances.  If an insn needs to be split for delay slot scheduling
  556. or insn scheduling, the insn is already known to be valid, which means
  557. that it must have been matched by some `define_insn' and, if
  558. `reload_completed' is non-zero, is known to satisfy the constraints of
  559. that `define_insn'.  In that case, the new insn patterns must also be
  560. insns that are matched by some `define_insn' and, if `reload_completed'
  561. is non-zero, must also satisfy the constraints of those definitions.
  562.    As an example of this usage of `define_split', consider the following
  563. example from `a29k.md', which splits a `sign_extend' from `HImode' to
  564. `SImode' into a pair of shift insns:
  565.      (define_split
  566.        [(set (match_operand:SI 0 "gen_reg_operand" "")
  567.              (sign_extend:SI (match_operand:HI 1 "gen_reg_operand" "")))]
  568.        ""
  569.        [(set (match_dup 0)
  570.              (ashift:SI (match_dup 1)
  571.                         (const_int 16)))
  572.         (set (match_dup 0)
  573.              (ashiftrt:SI (match_dup 0)
  574.                           (const_int 16)))]
  575.        "
  576.      { operands[1] = gen_lowpart (SImode, operands[1]); }")
  577.    When the combiner phase tries to split an insn pattern, it is always
  578. the case that the pattern is *not* matched by any `define_insn'.  The
  579. combiner pass first tries to split a single `set' expression and then
  580. the same `set' expression inside a `parallel', but followed by a
  581. `clobber' of a pseudo-reg to use as a scratch register.  In these
  582. cases, the combiner expects exactly two new insn patterns to be
  583. generated.  It will verify that these patterns match some `define_insn'
  584. definitions, so you need not do this test in the `define_split' (of
  585. course, there is no point in writing a `define_split' that will never
  586. produce insns that match).
  587.    Here is an example of this use of `define_split', taken from
  588. `rs6000.md':
  589.      (define_split
  590.        [(set (match_operand:SI 0 "gen_reg_operand" "")
  591.              (plus:SI (match_operand:SI 1 "gen_reg_operand" "")
  592.                       (match_operand:SI 2 "non_add_cint_operand" "")))]
  593.        ""
  594.        [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
  595.         (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
  596.      "
  597.      {
  598.        int low = INTVAL (operands[2]) & 0xffff;
  599.        int high = (unsigned) INTVAL (operands[2]) >> 16;
  600.      
  601.        if (low & 0x8000)
  602.          high++, low |= 0xffff0000;
  603.      
  604.        operands[3] = GEN_INT (high << 16);
  605.        operands[4] = GEN_INT (low);
  606.      }")
  607.    Here the predicate `non_add_cint_operand' matches any `const_int'
  608. that is *not* a valid operand of a single add insn.  The add with the
  609. smaller displacement is written so that it can be substituted into the
  610. address of a subsequent operation.
  611.    An example that uses a scratch register, from the same file,
  612. generates an equality comparison of a register and a large constant:
  613.      (define_split
  614.        [(set (match_operand:CC 0 "cc_reg_operand" "")
  615.              (compare:CC (match_operand:SI 1 "gen_reg_operand" "")
  616.                          (match_operand:SI 2 "non_short_cint_operand" "")))
  617.         (clobber (match_operand:SI 3 "gen_reg_operand" ""))]
  618.        "find_single_use (operands[0], insn, 0)
  619.         && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
  620.             || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
  621.        [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
  622.         (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
  623.        "
  624.      {
  625.        /* Get the constant we are comparing against, C, and see what it
  626.           looks like sign-extended to 16 bits.  Then see what constant
  627.           could be XOR'ed with C to get the sign-extended value.  */
  628.      
  629.        int c = INTVAL (operands[2]);
  630.        int sextc = (c << 16) >> 16;
  631.        int xorv = c ^ sextc;
  632.      
  633.        operands[4] = GEN_INT (xorv);
  634.        operands[5] = GEN_INT (sextc);
  635.      }")
  636.    To avoid confusion, don't write a single `define_split' that accepts
  637. some insns that match some `define_insn' as well as some insns that
  638. don't.  Instead, write two separate `define_split' definitions, one for
  639. the insns that are valid and one for the insns that are not valid.
  640. File: gcc.info,  Node: Insn Attributes,  Prev: Insn Splitting,  Up: Machine Desc
  641. Instruction Attributes
  642. ======================
  643.    In addition to describing the instruction supported by the target
  644. machine, the `md' file also defines a group of "attributes" and a set of
  645. values for each.  Every generated insn is assigned a value for each
  646. attribute.  One possible attribute would be the effect that the insn
  647. has on the machine's condition code.  This attribute can then be used
  648. by `NOTICE_UPDATE_CC' to track the condition codes.
  649. * Menu:
  650. * Defining Attributes:: Specifying attributes and their values.
  651. * Expressions::         Valid expressions for attribute values.
  652. * Tagging Insns::       Assigning attribute values to insns.
  653. * Attr Example::        An example of assigning attributes.
  654. * Insn Lengths::        Computing the length of insns.
  655. * Constant Attributes:: Defining attributes that are constant.
  656. * Delay Slots::         Defining delay slots required for a machine.
  657. * Function Units::      Specifying information for insn scheduling.
  658. File: gcc.info,  Node: Defining Attributes,  Next: Expressions,  Up: Insn Attributes
  659. Defining Attributes and their Values
  660. ------------------------------------
  661.    The `define_attr' expression is used to define each attribute
  662. required by the target machine.  It looks like:
  663.      (define_attr NAME LIST-OF-VALUES DEFAULT)
  664.    NAME is a string specifying the name of the attribute being defined.
  665.    LIST-OF-VALUES is either a string that specifies a comma-separated
  666. list of values that can be assigned to the attribute, or a null string
  667. to indicate that the attribute takes numeric values.
  668.    DEFAULT is an attribute expression that gives the value of this
  669. attribute for insns that match patterns whose definition does not
  670. include an explicit value for this attribute.  *Note Attr Example::,
  671. for more information on the handling of defaults.  *Note Constant
  672. Attributes::, for information on attributes that do not depend on any
  673. particular insn.
  674.    For each defined attribute, a number of definitions are written to
  675. the `insn-attr.h' file.  For cases where an explicit set of values is
  676. specified for an attribute, the following are defined:
  677.    * A `#define' is written for the symbol `HAVE_ATTR_NAME'.
  678.    * An enumeral class is defined for `attr_NAME' with elements of the
  679.      form `UPPER-NAME_UPPER-VALUE' where the attribute name and value
  680.      are first converted to upper case.
  681.    * A function `get_attr_NAME' is defined that is passed an insn and
  682.      returns the attribute value for that insn.
  683.    For example, if the following is present in the `md' file:
  684.      (define_attr "type" "branch,fp,load,store,arith" ...)
  685. the following lines will be written to the file `insn-attr.h'.
  686.      #define HAVE_ATTR_type
  687.      enum attr_type {TYPE_BRANCH, TYPE_FP, TYPE_LOAD,
  688.                       TYPE_STORE, TYPE_ARITH};
  689.      extern enum attr_type get_attr_type ();
  690.    If the attribute takes numeric values, no `enum' type will be
  691. defined and the function to obtain the attribute's value will return
  692. `int'.
  693. File: gcc.info,  Node: Expressions,  Next: Tagging Insns,  Prev: Defining Attributes,  Up: Insn Attributes
  694. Attribute Expressions
  695. ---------------------
  696.    RTL expressions used to define attributes use the codes described
  697. above plus a few specific to attribute definitions, to be discussed
  698. below.  Attribute value expressions must have one of the following
  699. forms:
  700. `(const_int I)'
  701.      The integer I specifies the value of a numeric attribute.  I must
  702.      be non-negative.
  703.      The value of a numeric attribute can be specified either with a
  704.      `const_int', or as an integer represented as a string in
  705.      `const_string', `eq_attr' (see below), `attr', `symbol_ref',
  706.      simple arithmetic expressions, and `set_attr' overrides on
  707.      specific instructions (*note Tagging Insns::.).
  708. `(const_string VALUE)'
  709.      The string VALUE specifies a constant attribute value.  If VALUE
  710.      is specified as `"*"', it means that the default value of the
  711.      attribute is to be used for the insn containing this expression.
  712.      `"*"' obviously cannot be used in the DEFAULT expression of a
  713.      `define_attr'.
  714.      If the attribute whose value is being specified is numeric, VALUE
  715.      must be a string containing a non-negative integer (normally
  716.      `const_int' would be used in this case).  Otherwise, it must
  717.      contain one of the valid values for the attribute.
  718. `(if_then_else TEST TRUE-VALUE FALSE-VALUE)'
  719.      TEST specifies an attribute test, whose format is defined below.
  720.      The value of this expression is TRUE-VALUE if TEST is true,
  721.      otherwise it is FALSE-VALUE.
  722. `(cond [TEST1 VALUE1 ...] DEFAULT)'
  723.      The first operand of this expression is a vector containing an even
  724.      number of expressions and consisting of pairs of TEST and VALUE
  725.      expressions.  The value of the `cond' expression is that of the
  726.      VALUE corresponding to the first true TEST expression.  If none of
  727.      the TEST expressions are true, the value of the `cond' expression
  728.      is that of the DEFAULT expression.
  729.    TEST expressions can have one of the following forms:
  730. `(const_int I)'
  731.      This test is true if I is non-zero and false otherwise.
  732. `(not TEST)'
  733. `(ior TEST1 TEST2)'
  734. `(and TEST1 TEST2)'
  735.      These tests are true if the indicated logical function is true.
  736. `(match_operand:M N PRED CONSTRAINTS)'
  737.      This test is true if operand N of the insn whose attribute value
  738.      is being determined has mode M (this part of the test is ignored
  739.      if M is `VOIDmode') and the function specified by the string PRED
  740.      returns a non-zero value when passed operand N and mode M (this
  741.      part of the test is ignored if PRED is the null string).
  742.      The CONSTRAINTS operand is ignored and should be the null string.
  743. `(le ARITH1 ARITH2)'
  744. `(leu ARITH1 ARITH2)'
  745. `(lt ARITH1 ARITH2)'
  746. `(ltu ARITH1 ARITH2)'
  747. `(gt ARITH1 ARITH2)'
  748. `(gtu ARITH1 ARITH2)'
  749. `(ge ARITH1 ARITH2)'
  750. `(geu ARITH1 ARITH2)'
  751. `(ne ARITH1 ARITH2)'
  752. `(eq ARITH1 ARITH2)'
  753.      These tests are true if the indicated comparison of the two
  754.      arithmetic expressions is true.  Arithmetic expressions are formed
  755.      with `plus', `minus', `mult', `div', `mod', `abs', `neg', `and',
  756.      `ior', `xor', `not', `ashift', `lshiftrt', and `ashiftrt'
  757.      expressions.
  758.      `const_int' and `symbol_ref' are always valid terms (*note Insn
  759.      Lengths::.,for additional forms).  `symbol_ref' is a string
  760.      denoting a C expression that yields an `int' when evaluated by the
  761.      `get_attr_...' routine.  It should normally be a global variable.
  762. `(eq_attr NAME VALUE)'
  763.      NAME is a string specifying the name of an attribute.
  764.      VALUE is a string that is either a valid value for attribute NAME,
  765.      a comma-separated list of values, or `!' followed by a value or
  766.      list.  If VALUE does not begin with a `!', this test is true if
  767.      the value of the NAME attribute of the current insn is in the list
  768.      specified by VALUE.  If VALUE begins with a `!', this test is true
  769.      if the attribute's value is *not* in the specified list.
  770.      For example,
  771.           (eq_attr "type" "load,store")
  772.      is equivalent to
  773.           (ior (eq_attr "type" "load") (eq_attr "type" "store"))
  774.      If NAME specifies an attribute of `alternative', it refers to the
  775.      value of the compiler variable `which_alternative' (*note Output
  776.      Statement::.) and the values must be small integers.  For example,
  777.           (eq_attr "alternative" "2,3")
  778.      is equivalent to
  779.           (ior (eq (symbol_ref "which_alternative") (const_int 2))
  780.                (eq (symbol_ref "which_alternative") (const_int 3)))
  781.      Note that, for most attributes, an `eq_attr' test is simplified in
  782.      cases where the value of the attribute being tested is known for
  783.      all insns matching a particular pattern.  This is by far the most
  784.      common case.
  785. `(attr_flag NAME)'
  786.      The value of an `attr_flag' expression is true if the flag
  787.      specified by NAME is true for the `insn' currently being scheduled.
  788.      NAME is a string specifying one of a fixed set of flags to test.
  789.      Test the flags `forward' and `backward' to determine the direction
  790.      of a conditional branch.  Test the flags `very_likely', `likely',
  791.      `very_unlikely', and `unlikely' to determine if a conditional
  792.      branch is expected to be taken.
  793.      If the `very_likely' flag is true, then the `likely' flag is also
  794.      true.  Likewise for the `very_unlikely' and `unlikely' flags.
  795.      This example describes a conditional branch delay slot which can
  796.      be nullified for forward branches that are taken (annul-true) or
  797.      for backward branches which are not taken (annul-false).
  798.           (define_delay (eq_attr "type" "cbranch")
  799.             [(eq_attr "in_branch_delay" "true")
  800.              (and (eq_attr "in_branch_delay" "true")
  801.                   (attr_flag "forward"))
  802.              (and (eq_attr "in_branch_delay" "true")
  803.                   (attr_flag "backward"))])
  804.      The `forward' and `backward' flags are false if the current `insn'
  805.      being scheduled is not a conditional branch.
  806.      The `very_likely' and `likely' flags are true if the `insn' being
  807.      scheduled is not a conditional branch.  The `very_unlikely' and
  808.      `unlikely' flags are false if the `insn' being scheduled is not a
  809.      conditional branch.
  810.      `attr_flag' is only used during delay slot scheduling and has no
  811.      meaning to other passes of the compiler.
  812. `(attr NAME)'
  813.      The value of another attribute is returned.  This is most useful
  814.      for numeric attributes, as `eq_attr' and `attr_flag' produce more
  815.      efficient code for non-numeric attributes.
  816. File: gcc.info,  Node: Tagging Insns,  Next: Attr Example,  Prev: Expressions,  Up: Insn Attributes
  817. Assigning Attribute Values to Insns
  818. -----------------------------------
  819.    The value assigned to an attribute of an insn is primarily
  820. determined by which pattern is matched by that insn (or which
  821. `define_peephole' generated it).  Every `define_insn' and
  822. `define_peephole' can have an optional last argument to specify the
  823. values of attributes for matching insns.  The value of any attribute
  824. not specified in a particular insn is set to the default value for that
  825. attribute, as specified in its `define_attr'.  Extensive use of default
  826. values for attributes permits the specification of the values for only
  827. one or two attributes in the definition of most insn patterns, as seen
  828. in the example in the next section.
  829.    The optional last argument of `define_insn' and `define_peephole' is
  830. a vector of expressions, each of which defines the value for a single
  831. attribute.  The most general way of assigning an attribute's value is
  832. to use a `set' expression whose first operand is an `attr' expression
  833. giving the name of the attribute being set.  The second operand of the
  834. `set' is an attribute expression (*note Expressions::.) giving the
  835. value of the attribute.
  836.    When the attribute value depends on the `alternative' attribute
  837. (i.e., which is the applicable alternative in the constraint of the
  838. insn), the `set_attr_alternative' expression can be used.  It allows
  839. the specification of a vector of attribute expressions, one for each
  840. alternative.
  841.    When the generality of arbitrary attribute expressions is not
  842. required, the simpler `set_attr' expression can be used, which allows
  843. specifying a string giving either a single attribute value or a list of
  844. attribute values, one for each alternative.
  845.    The form of each of the above specifications is shown below.  In
  846. each case, NAME is a string specifying the attribute to be set.
  847. `(set_attr NAME VALUE-STRING)'
  848.      VALUE-STRING is either a string giving the desired attribute value,
  849.      or a string containing a comma-separated list giving the values for
  850.      succeeding alternatives.  The number of elements must match the
  851.      number of alternatives in the constraint of the insn pattern.
  852.      Note that it may be useful to specify `*' for some alternative, in
  853.      which case the attribute will assume its default value for insns
  854.      matching that alternative.
  855. `(set_attr_alternative NAME [VALUE1 VALUE2 ...])'
  856.      Depending on the alternative of the insn, the value will be one of
  857.      the specified values.  This is a shorthand for using a `cond' with
  858.      tests on the `alternative' attribute.
  859. `(set (attr NAME) VALUE)'
  860.      The first operand of this `set' must be the special RTL expression
  861.      `attr', whose sole operand is a string giving the name of the
  862.      attribute being set.  VALUE is the value of the attribute.
  863.    The following shows three different ways of representing the same
  864. attribute value specification:
  865.      (set_attr "type" "load,store,arith")
  866.      
  867.      (set_attr_alternative "type"
  868.                            [(const_string "load") (const_string "store")
  869.                             (const_string "arith")])
  870.      
  871.      (set (attr "type")
  872.           (cond [(eq_attr "alternative" "1") (const_string "load")
  873.                  (eq_attr "alternative" "2") (const_string "store")]
  874.                 (const_string "arith")))
  875.    The `define_asm_attributes' expression provides a mechanism to
  876. specify the attributes assigned to insns produced from an `asm'
  877. statement.  It has the form:
  878.      (define_asm_attributes [ATTR-SETS])
  879. where ATTR-SETS is specified the same as for both the `define_insn' and
  880. the `define_peephole' expressions.
  881.    These values will typically be the "worst case" attribute values.
  882. For example, they might indicate that the condition code will be
  883. clobbered.
  884.    A specification for a `length' attribute is handled specially.  The
  885. way to compute the length of an `asm' insn is to multiply the length
  886. specified in the expression `define_asm_attributes' by the number of
  887. machine instructions specified in the `asm' statement, determined by
  888. counting the number of semicolons and newlines in the string.
  889. Therefore, the value of the `length' attribute specified in a
  890. `define_asm_attributes' should be the maximum possible length of a
  891. single machine instruction.
  892. File: gcc.info,  Node: Attr Example,  Next: Insn Lengths,  Prev: Tagging Insns,  Up: Insn Attributes
  893. Example of Attribute Specifications
  894. -----------------------------------
  895.    The judicious use of defaulting is important in the efficient use of
  896. insn attributes.  Typically, insns are divided into "types" and an
  897. attribute, customarily called `type', is used to represent this value.
  898. This attribute is normally used only to define the default value for
  899. other attributes.  An example will clarify this usage.
  900.    Assume we have a RISC machine with a condition code and in which only
  901. full-word operations are performed in registers.  Let us assume that we
  902. can divide all insns into loads, stores, (integer) arithmetic
  903. operations, floating point operations, and branches.
  904.    Here we will concern ourselves with determining the effect of an
  905. insn on the condition code and will limit ourselves to the following
  906. possible effects:  The condition code can be set unpredictably
  907. (clobbered), not be changed, be set to agree with the results of the
  908. operation, or only changed if the item previously set into the
  909. condition code has been modified.
  910.    Here is part of a sample `md' file for such a machine:
  911.      (define_attr "type" "load,store,arith,fp,branch" (const_string "arith"))
  912.      
  913.      (define_attr "cc" "clobber,unchanged,set,change0"
  914.                   (cond [(eq_attr "type" "load")
  915.                              (const_string "change0")
  916.                          (eq_attr "type" "store,branch")
  917.                              (const_string "unchanged")
  918.                          (eq_attr "type" "arith")
  919.                              (if_then_else (match_operand:SI 0 "" "")
  920.                                            (const_string "set")
  921.                                            (const_string "clobber"))]
  922.                         (const_string "clobber")))
  923.      
  924.      (define_insn ""
  925.        [(set (match_operand:SI 0 "general_operand" "=r,r,m")
  926.              (match_operand:SI 1 "general_operand" "r,m,r"))]
  927.        ""
  928.        "@
  929.         move %0,%1
  930.         load %0,%1
  931.         store %0,%1"
  932.        [(set_attr "type" "arith,load,store")])
  933.    Note that we assume in the above example that arithmetic operations
  934. performed on quantities smaller than a machine word clobber the
  935. condition code since they will set the condition code to a value
  936. corresponding to the full-word result.
  937.